package com.isoftstone.securityframework.device.domain;

import com.isoftstone.securityframework.api.domain.MysqlQuerySupport;
import com.isoftstone.securityframework.api.domain.Query;
/**
 * 设备查询对象
 * @author david
 *
 */
public class DeviceQuery extends Query implements MysqlQuerySupport{

	private Integer roleId;
	private Integer deviceGroupId;
	private Integer limit;
	private Integer offset;
	
	public Integer getRoleId() {
		return roleId;
	}
	public void setRoleId(Integer roleId) {
		this.roleId = roleId;
	}
	public Integer getLimit() {
		if(this.getPage()==null || this.getRows()==null)return null;
		int start = (this.getPage() - 1) * this.getRows();
		int end = this.getPage() * this.getRows();
		limit = end-start;
		return limit;
	}

	public Integer getOffset() {
		if(this.getPage()==null || this.getRows()==null)return null;
		offset = (this.getPage() - 1) * this.getRows();
		return offset;
	}

	public Integer getDeviceGroupId() {
		return deviceGroupId;
	}
	public void setDeviceGroupId(Integer deviceGroupId) {
		this.deviceGroupId = deviceGroupId;
	}

}
